package itheima04;

import java.io.*;

/**
 * @author xxx
 * @date 2020/12/27 0:35
 * @description
 */
public class Test {
    public static void main(String[] args) throws IOException {
        FileOutputStream fileOutputStream=new FileOutputStream("D:\\java349\\day14\\from\\f1.txt");
        FileInputStream fileInputStream=new FileInputStream("D:\\java349\\day14\\upload\\f1.txt");

        Reader reader=new InputStreamReader(fileInputStream);
        Writer writer=new OutputStreamWriter(fileOutputStream);

        //BufferedWriter高效缓冲字符输入流 BufferedWriter是writer的实现类
        //BufferedReader高校缓存字符输出流 BufferedReader是reader的实现类
        BufferedWriter bufferedWriter=new BufferedWriter(writer);
        BufferedReader bufferedReader=new BufferedReader(reader);

        String line=null;
        while ((line=bufferedReader.readLine())!=null){
            bufferedWriter.write(line);
            bufferedWriter.newLine();
        }

        bufferedReader.close();
        bufferedWriter.close();
    }
}
